
package com.scs.application.modules.doc.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.model.CommonResult;
import com.scs.application.core.model.PageResult;
import com.scs.application.core.mvc.controller.CrudController;
import com.scs.application.modules.doc.entity.FileInfo;
import com.scs.application.modules.doc.request.FileInfoQueryRequest;
import com.scs.application.modules.doc.service.FileInfoService;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* 文件 controller
*
*/
@AllArgsConstructor
@RestController
@RequestMapping("/doc/file_infos")
public class FileInfoController extends CrudController<FileInfo,String, FileInfoService> {

    private FileInfoService fileInfoService;

    @GetMapping("/page")
    public PageResult page(FileInfoQueryRequest request) {
        IPage page = fileInfoService.page(request);
        return PageResult.ok("查询成功", page.getRecords(), page.getTotal());
    }

    @GetMapping("/list")
    public CommonResult list(FileInfoQueryRequest request) {
        List<FileInfo> list = fileInfoService.list(request);
        return CommonResult.ok("查询成功", list);
    }

}
